# -*- coding: utf-8 -*-
__author__ = 'gerry'

import random

real_num = random.randrange(10)
#retry_count = 0
#while retry_count < 3:
for i in range(3):
    guess_num = raw_input("Please guess the real num:").strip()  # strip()去除空格和字符串
    if len(guess_num) == 0:
        continue
    if guess_num.isdigit():
        guess_num = int(guess_num)
    else:
        print("Your need input a integer instead of string!")
    if guess_num > real_num:
        print("Wrong! you need try smaller!")
    elif guess_num < real_num:
        print("Wrong! you need try bigger!")
    else:
        print("Right! you are very good! "
              "The real num is %s" % real_num)
        break
    #retry_count += 1
else:
    print("The real num is %s" % real_num)




